(*
  Copyright (c) 2009 Barry Schwartz

  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation
  files (the "Software"), to deal in the Software without
  restriction, including without limitation the rights to use,
  copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following
  conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.
*)

open XNum
open VMTypes
open UTypes
  
type scope = Scope.scope

val tracing_bytecode : bool ref
val make_scope : unit -> scope
val bind_primitive : scope -> string -> partial_value -> unit
val bind_bin_op_l : scope -> string -> int -> partial_value -> unit
val bind_bin_op_n : scope -> string -> int -> partial_value -> unit
val bind_bin_op_r : scope -> string -> int -> partial_value -> unit
val bind_pre_op : scope -> string -> partial_value -> unit
val bind_post_op : scope -> string -> partial_value -> unit
val lookup_symbol : scope -> uc_string -> partial_value
val string_to_symbol : uc_string -> SymbolTable.symbol
val symbol_to_string : SymbolTable.symbol -> uc_string
val execute_declarations : scope -> UCStream.istream -> unit
val evaluate_expression : scope -> UCStream.istream -> partial_value
val evaluate_monad_expr :
  scope -> UCStream.istream -> partial_value -> partial_value
val evaluate_string_expr : string -> scope -> UCStream.istream -> uc_list
val evaluate_function : unknown -> unknown list -> unknown
val evaluate_lin_form : unknown -> unknown LinForm.lin_form -> unit
val unify : unknown -> unknown -> bool
val set_unknown : unknown -> partial_value -> unit
val uc_string_to_char_list : uc_string -> partial_value
val uc_list_to_char_list : uc_list -> partial_value
val ascii_to_char_list : string -> partial_value
val evaluate_opaque :
  string -> (unknown Opaque.opaque -> 'a) -> string -> unknown -> 'a
val decode_list : string -> unknown -> unknown list
val decode_string : string -> unknown -> uc_list
val decode_num : string -> unknown -> num
  

